<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ include file="/WEB-INF/jsp/sys/css.jsp"%>
<%@ include file="/WEB-INF/jsp/sys/uploader.jsp"%>
<%@page import="com.centit.util.RequestUtil"%>

<html lang="zh-cmn-Hans">
<head>
<title></title>
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/modules/util/static/ztree/css/metroStyle/metroStyle.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/modules/util/static/plugin/css/index.css">
<script type="text/javascript"
	src="${pageContext.request.contextPath}/modules/util/static/ztree/js/jquery.ztree.all.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/modules/util/static/plugin/js/selectTree.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/modules/airplanebaseinfo/airplanebaseinfo/ctrl/tableExport.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/modules/airplanebaseinfo/airplanebaseinfo/ctrl/airplanebaseinfoBl.js"></script>
<style type="text/css">
.layui-form-select {
	width: 80%;
	float: left;
}

.layui-input, .layui-select, .layui-textarea {
	border-width: 0px;
}

.stream-main-upload-box {
	border: none;
}

.centit-uploader .uploaded-files li {
	padding: 10px 20px 10px 10px;
}

.uploaded-delete {
	display: none;
}
.stream-main-upload-box {
	/* width: 228px !important; */
}
</style>
<script type="text/javascript">
function frameWH() {
    var processLogPageframe = document.getElementById("processLogPage");
    var stuffPageIframe = document.getElementById("stuffPage");
    if (navigator.userAgent.indexOf("MSIE") > 0 || navigator.userAgent.indexOf("rv:11") > 0 || navigator.userAgent.indexOf("Firefox") > 0) {
        if (processLogPageframe != null) {
            processLogPageframe.height = processLogPageframe.contentWindow.document.body.scrollHeight;
        }
        if (stuffPageIframe != null) {
            stuffPageIframe.height = stuffPageIframe.contentWindow.document.body.scrollHeight;
        }
    } else {
        if (processLogPageframe != null) {
            processLogPageframe.height = processLogPageframe.contentWindow.document.documentElement.scrollHeight;
        }
        if (stuffPageIframe != null) {
            stuffPageIframe.height = stuffPageIframe.contentWindow.document.documentElement.scrollHeight;
        }
    }
}
function frameWHTimeOut() {
    setTimeout(function () {
        var processLogPageframe = document.getElementById("processLogPage");
        var stuffPageIframe = document.getElementById("stuffPage");
        if (navigator.userAgent.indexOf("MSIE") > 0 || navigator.userAgent.indexOf("rv:11") > 0 || navigator.userAgent.indexOf("Firefox") > 0) {
            if (processLogPageframe != null) {
                processLogPageframe.height = processLogPageframe.contentWindow.document.body.scrollHeight;
            }
            if (stuffPageIframe != null) {
                stuffPageIframe.height = stuffPageIframe.contentWindow.document.body.scrollHeight;
            }
        } else {
            if (processLogPageframe != null) {
                processLogPageframe.height = processLogPageframe.contentWindow.document.documentElement.scrollHeight;
            }
            if (stuffPageIframe != null) {
                stuffPageIframe.height = stuffPageIframe.contentWindow.document.documentElement.scrollHeight;
            }
        }
    }, 500)
}

</script>
</head>
<body>
<div >
     <div class="layui-tab layui-tab-brief moduleTabs" style="height:auto;" lay-filter="tabs">
            <ul class="layui-tab-title" style="float:left;margin-left:10px;font-weight:bold;">
                <li class="layui-this" onclick="frameWHTimeOut()">航空器详情</li>
            </ul>
        
<!--             <a class="layui-btn"   type="submit" lay-submit="" style="float: right;background-color: 6495ED;" id="airplanInfo">航空器详情</a> -->
 			<a class="layui-btn"  type="submit" style="background-color: red;margin-left:10px;float: right;margin-right: 10px;" lay-submit="" id="moduleSubmit">发送</a>
             <a class="layui-btn" style="margin-left:10px;float: right;" type="submit" lay-submit="" id="airplanEdit">办理</a>
              <a class="layui-btn" style="float: right;margin-left:10px;" type="submit" lay-submit="" id="airplanExport">导出</a>
              <c:if test="${ideaType eq '飞机引进计划'}">
             	 <a class="layui-btn" style="float: right;" type="submit" lay-submit="" id="flowEnd">飞机完成引进</a>
               </c:if>
               <c:if test="${ideaType eq '日常维护变更'}">
             	 <a class="layui-btn" style="float: right;" type="submit" lay-submit="" id="flowEndRc">飞机运维完成</a>
               </c:if>
   </div>
</div>
	<form class="layui-form" action="" style="padding: 10px;padding-top: 48px;"
		lay-filter="azdbqryForm" id="viewForm">
		<input type="hidden" name="recId" id="recId" value="${object.recId}">
		<input type="hidden" name="flowRecId" id="flowRecId" value="${object.flowInsId}">
		<input type="hidden" name="transContent" id="transContent" value="">
		<input type="hidden" name="nextUser" id="nextUser" value="">
		<input type="hidden" name="nextUserName" id="nextUserName" value="">
		<input type="hidden" name="flowState" id="flowState" />
		<table class="viewTable" id="viewTable" lay-filter="viewTable">
			<tr>
				<th>飞机状态</th>
				<td><c:forEach items="${cp:DICTIONARY('AIRZT')}" var="row">
				         			<c:if test="${object.airZt eq row.dataCode }">
				         			<input type="text" name="txt1" id="txt1" class="layui-input" lay-verify="required" value="${row.dataValue }" readonly="readonly">
				         			</c:if>
				   				</c:forEach></td>
				<th>飞机性质</th>
				<td><c:forEach items="${cp:DICTIONARY('AIRXZ')}" var="row">
				         			 <c:if test="${object.nature eq row.dataCode }">
				         			 <input type="text" name="txt2" id="txt2" class="layui-input" lay-verify="required" value="${row.dataValue }" readonly="readonly"></c:if>
				   				</c:forEach>
				</td>
				
				<th>租赁到期日期</th>
				<td><input type="text" name="endTime" id="endTime"
					class="layui-input"
					value="<fmt:formatDate value='${object.endTime}' pattern='yyyy-MM-dd'/>"
					disabled="disabled"></td>
			
			
			</tr>
			<tr>
			
				<th>国籍标志和登记标志</th>
				<td><input type="text" name="sign" id="sign"
					class="layui-input" lay-verify="required" value="${object.sign}"
					readonly="readonly"></td>
				<th>航空器型号和制造人</th>
				<td><input type="text" name="airModel" id="airModel"
					class="layui-input" lay-verify="required"
					value="${object.airModel}" readonly="readonly"></td>
					<th>航空器出厂序号</th>
				<td><input type="text" name="ccxlh" id="ccxlh"
					class="layui-input" lay-verify="required" value="${object.ccxlh}"
					readonly="readonly"></td>	
			</tr>
			<tr>
				<th>出厂日期</th>
				<td><input type="text" name="proctionDate" id="proctionDate"
					class="layui-input" lay-verify="required"
					value="<fmt:formatDate value='${object.proctionDate}' pattern='yyyy-MM-dd'/>"
					disabled="disabled"></td>
					<th>调机日期</th>
				<td><input type="text" name="useDate" id="useDate"
					class="layui-input" lay-verify="required"
					value="<fmt:formatDate value='${object.useDate}' pattern='yyyy-MM-dd'/>"
					disabled="disabled"></td>	
					<th>注销日期</th>
				<td><input type="text" name="offDate" id="offDate"
					class="layui-input"
					value="<fmt:formatDate value='${object.offDate}' pattern='yyyy-MM-dd'/>"
					disabled="disabled"></td>
			</tr>
			<tr>
			<th>国籍登记证编号</th>
				<td><input type="text" name="gjNo" id="gjNo"
					class="layui-input" lay-verify="required" value="${object.gjNo}"
					readonly="readonly"></td>
			<th class="required">占有权登记</th>
				<td>
					<input type="text" name="zyqdj" id="zyqdj" lay-verify="required" class="layui-input" readonly="readonly"  value="${object.zyqdj}">
				</td>
				<th class="required">IDERA登记</th>
				<td>
				<input type="text" name="idera" id="idera" lay-verify="required" class="layui-input" readonly="readonly"  value="${object.idera}">
				</td>
			
			</tr>
			<tr>
				<th>登记时间</th>
				<td><input type="text" name="djsj" id="djsj"
					class="layui-input" lay-verify="required" value="${object.djsj}"
					disabled="disabled"></td>
				
				<th>Engine serie</th>
				<td><input type="text" name="engineS" id="engineS"
					class="layui-input" lay-verify="required" value="${object.engineS}"
					readonly="readonly"></td>
					<th>Engine</th>
				<td><input type="text" name="engine" id="engine"
					class="layui-input" lay-verify="required" value="${object.engine}"
					readonly="readonly"></td>	
			</tr>
			<tr>
				<th>1st engine SN（出厂序号）</th>
				<td><input type="text" name="oneSn" id="oneSn"
					class="layui-input" lay-verify="required" value="${object.oneSn}"
					readonly="readonly"></td>
				<th>2nd engine SN（出厂序号）</th>
				<td><input type="text" name="twoSn" id="twoSn"
					class="layui-input" lay-verify="required" value="${object.twoSn}"
					readonly="readonly"></td>
					<th>选择呼叫代码</th>
				<td><input type="text" name="hjNo" id="hjNo"
					class="layui-input" lay-verify="required" value="${object.hjNo}"
					readonly="readonly"></td>
			</tr>
			<tr>
				<th>国籍登记证签发日期</th>
				<td><input type="text" name="gjDate" id="gjDate"
					class="layui-input" lay-verify="required"
					value="<fmt:formatDate value='${object.gjDate}' pattern='yyyy-MM-dd'/>"
					disabled="disabled"></td>
				<th>所有人名称</th>
				<td><input type="text" name="haveName" id="haveName"
					class="layui-input" lay-verify="required"
					value="${object.haveName}" readonly="readonly"></td>
				<th>所有人地址</th>
				<td><input type="text" name="haveAddr" id="haveAddr"
					class="layui-input" lay-verify="required"
					value="${object.haveAddr}" readonly="readonly"></td>
			</tr>
			<tr>
				<th>运营人</th>
				<td><input type="text" name="yyName" id="yyName"
					class="layui-input" lay-verify="required" value="${object.yyName}"
					readonly="readonly"></td>
				<th>运营人地址</th>
				<td><input type="text" name="yyAddr" id="yyAddr"
					class="layui-input" lay-verify="required" value="${object.yyAddr}"
					readonly="readonly"></td>
				<th>标准适航证编号</th>
				<td><input type="text" name="shNo" id="shNo"
					class="layui-input" lay-verify="required" value="${object.shNo}"
					readonly="readonly"></td>
			</tr>
			<tr>
				<th>标准适航证签发日期</th>
				<td><input type="text" name="qfDate" id="qfDate"
					class="layui-input" lay-verify="required"
					value="<fmt:formatDate value='${object.qfDate}' pattern='yyyy-MM-dd'/>"
					disabled="disabled"></td>
				<th>航空器地址编码（S模式）HEX</th>
				<td><input type="text" name="addrNoHex" id="addrNoHex"
					class="layui-input" lay-verify="required"
					value="${object.addrNoHex}" readonly="readonly"></td>
				<th>航空器地址编码（S模式）OCT</th>
				<td><input type="text" name="addrNoOct" id="addrNoOct"
					class="layui-input" lay-verify="required"
					value="${object.addrNoOct}" readonly="readonly"></td>
			</tr>
			<tr>
				
				<th>电台执照序号</th>
				<td><input type="text" name="dtNo" id="dtNo"
					class="layui-input" lay-verify="required" value="${object.dtNo}"
					readonly="readonly"></td>
				<th>电台执照有效期限</th>
				<td><input type="text" name="dtyxDate" id="dtyxDate"
					class="layui-input" lay-verify="required"
					value="<fmt:formatDate value='${object.dtyxDate}' pattern='yyyy-MM-dd'/>"
					disabled="disabled"></td>
					<th>电台执照颁发日期</th>
				<td><input type="text" name="dtbfDate" id="dtbfDate"
					class="layui-input" lay-verify="required"
					value="<fmt:formatDate value='${object.dtbfDate}' pattern='yyyy-MM-dd'/>"
					disabled="disabled"></td>
			</tr>
			<tr>
			<th>飞机原值</th>
			<td><input type="text" name="fjyz" id="fjyz"
					class="layui-input" lay-verify="required"
					value="${object.fjyz}" readonly="readonly"></td>
			<th>飞机残值</th>
			<td><input type="text" name="fjcz" id="fjcz"
					class="layui-input" lay-verify="required"
					value="${object.fjcz}" readonly="readonly"></td>
			<th>保险信息</th>
			<td><input type="text" name="bxxx" id="bxxx"
					class="layui-input" lay-verify="required"
					value="${object.bxxx}" readonly="readonly"></td>
			</tr>
				<tr>
			<th>租金币种</th>
			<td>
			<c:forEach items="${cp:DICTIONARY('BZ')}" var="row">
				         			<c:if test="${object.zjbz eq row.dataCode }">
				         			<input type="text" name="txt3" id="txt3" class="layui-input"  value="${row.dataValue }" readonly="readonly">
				         			</c:if>
				   				</c:forEach>
			</td>
			<th>每期租金</th>
			<td><input type="text" name="mqzj" id="mqzj"
					class="layui-input" lay-verify="required"
					value="${object.mqzj}" readonly="readonly"></td>
			<th>租金支付期间</th>
			<td><input type="text" name="zjzfqj" id="zjzfqj" 
					class="layui-input" lay-verify="required" 
					value="${object.zjzfqj}" readonly="readonly"></td>
			</tr>
			<tr>
					<th>飞机合同</th>
				<td colspan="5">
					<div class="layui-input-inline tdcontent">
						<input type="hidden" id="ht" name="ht" value="${object.ht}" />
					</div>
				</td>
			</tr>
			<tr>
				<th>飞机批文</th>
	                    <td colspan="5">
	                        <div class="layui-input-inline tdcontent" >
	                        <input type="hidden"  id="pw" name="pw"  value="${object.pw}" disabled="disabled"/>
	                        </div>
	                    </td>
			</tr>
			<tr>
			<th>电台证</th>
				<td colspan="5">
					<div class="layui-input-inline tdcontent">
						<input type="hidden" id="dtz" name="dtz" value="${object.dtz}" />
					</div>
				</td>
				</tr>
			<tr>
				<th>适航证</th>
				<td colspan="5">
					<div class="layui-input-inline tdcontent">
						<input type="hidden" id="shz" name="shz" value="${object.shz}" />
					</div>
				</td>
				</tr>
			<tr>
				<th>国籍证</th>
				<td colspan="5">
					<div class="layui-input-inline tdcontent">
						<input type="hidden" id="gjz" name="gjz" value="${object.gjz}" />
					</div>
				</td>
				
			</tr>
		</table>
	</form>
		    <div class="layui-tab layui-tab-brief moduleTabs" style="height:auto;" lay-filter="tabs">
            <ul class="layui-tab-title" style="border-bottom-width: 0px;margin-left:10px;font-weight:bold;">
                <li class="layui-this" onclick="frameWHTimeOut()">办理日志</li>
               <!--  <li onclick="frameWHTimeOut()">材料列表</li> -->
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <iframe id="processLogPage" style="width: 100%;" scrolling="no" frameborder="0" marginheight="0"
                            marginwidth="0" onload="frameWH()" src=""></iframe>
                </div>
          <!--       <div class="layui-tab-item">
                    <iframe id="stuffPage" style="width: 100%;" scrolling="no" frameborder="0" marginheight="0"
                            marginwidth="0" src="" onload="frameWH()"></iframe>
                </div> -->
            </div>
        </div>
 	
	<script>
		var basePath = "${pageContext.request.contextPath}";
	</script>

	<script type="text/javascript">
		window.UploaderPath = '${cp:SYS_VALUE("uploaderpath")}/';
		
		
		index = setInterval(setUpload, '1000');
		function setUpload() {
			try {
				if (typeof $('#dtz', null).uploader === "function") {
					clearInterval(index);
					$('#dtz', null).uploader({
						UploaderPath : window.UploaderPath,
						ViewContextPath : window.UploaderPath,
						info : {
							optId : 'applyAdd'
						}
					});
				} else {

				}
				//如果是查看的需要去除附件中的操作按钮
				$(".centit-uploader").find("button").remove();//只读时候去除上传按钮，编辑新增此行代码去掉
				$("#i_select_files_upload_demo_0").find("button").remove();
				$("#i_select_files_upload_demo1_0").find("button").remove();
			} catch (e) {
			}
			try {
				if (typeof $('#shz', null).uploader === "function") {
					clearInterval(index);
					$('#shz', null).uploader({
						UploaderPath : window.UploaderPath,
						ViewContextPath : window.UploaderPath,
						info : {
							optId : 'applyAdd'
						}
					});
				} else {

				}
				//如果是查看的需要去除附件中的操作按钮
				$(".centit-uploader").find("button").remove();//只读时候去除上传按钮，编辑新增此行代码去掉
				$("#i_select_files_upload_demo_0").find("button").remove();
				$("#i_select_files_upload_demo1_0").find("button").remove();
			} catch (e) {
			}
			try {
				if (typeof $('#gjz', null).uploader === "function") {
					clearInterval(index);
					$('#gjz', null).uploader({
						UploaderPath : window.UploaderPath,
						ViewContextPath : window.UploaderPath,
						info : {
							optId : 'applyAdd'
						}
					});
				} else {

				}
				//如果是查看的需要去除附件中的操作按钮
				$(".centit-uploader").find("button").remove();//只读时候去除上传按钮，编辑新增此行代码去掉
				$("#i_select_files_upload_demo_0").find("button").remove();
				$("#i_select_files_upload_demo1_0").find("button").remove();
			} catch (e) {
			}
			try {
				if (typeof $('#ht', null).uploader === "function") {
					clearInterval(index);
					$('#ht', null).uploader({
						UploaderPath : window.UploaderPath,
						ViewContextPath : window.UploaderPath,
						info : {
							optId : 'applyAdd'
						}
					});
				} else {

				}
				//如果是查看的需要去除附件中的操作按钮
				$(".centit-uploader").find("button").remove();//只读时候去除上传按钮，编辑新增此行代码去掉
				$("#i_select_files_upload_demo_0").find("button").remove();
				$("#i_select_files_upload_demo1_0").find("button").remove();
			} catch (e) {
			}
			try {
		    	  if (typeof $('#pw', null).uploader === "function") { 
		              clearInterval(index);
		              $('#pw', null).uploader({
		                  UploaderPath: window.UploaderPath,           
		                  ViewContextPath: window.UploaderPath,
		                  info: {
		                      optId: 'applyAdd'    
		                  }
		              });
		          } else {
		        	  
		          }
		    	//如果是查看的需要去除附件中的操作按钮
		            $(".centit-uploader").find("button").remove();//只读时候去除上传按钮，编辑新增此行代码去掉
		            $("#i_select_files_upload_demo_0").find("button").remove();
		            $("#i_select_files_upload_demo1_0").find("button").remove(); 
		      } catch (e) {
		      }
		}
		$("#airplanExport").click(function() {
			
			    	$("#viewTable").tableExport({
						type:"excel",
						fileName:"航空器详情"
					});
		
			window.open(basePath+'/service/airplanebaseinfo/airplanebaseinfo/export?flowOptTag='+$("#recId").val());
		})
		
		function numFormat(num) {
	        var c = (num.toString().indexOf ('.') !== -1) ? num.toLocaleString() : num.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
	        return c;
	    }
		$(document).ready(function(){
			$("#mqzj").val(numFormat($("#mqzj").val()));
		});
		 function additem(id, name, valueName, valueCode) {
	        $('input[id^=' + valueCode + ']').val(id);
	        $('input[id^=' + valueName + ']').val(name);
	        $("#flowState").val("Normal");
	        $("#transContent").val(parent.$("#transContents").val());
	        $.ajax({
		        type: "POST",
		        url: basePath+'/service/airplanebaseinfo/airplanebaseinfo/submitFlow',
		        data: $("#viewForm").serialize(),
		        async:false,
		        dataType: "json",
		        success: function(data){
		        	if(data.code=='0'){
		        		layer.msg("操作成功", {icon: 1});
		        		 parent.location.reload();	
		    		} else {
		    			layer.msg("操作失败", {icon: 0});
		    		}
		        }
		    });
   		 }
	</script>
</body>
</html>
